% Text macros
\newcommand{\rmparen}[1]{{\rm (}#1{\rm )}}

% Document format settings
\makeatletter
\def\cleardoublepage{%
    \clearpage\if@twoside
    \ifodd\c@page\else\thispagestyle{empty}
    \tikz[remember picture, overlay] \node  at (current page.center) {\Large\itshape 本页特意留空.};
    \newpage
    \if@twocolumn\hbox{}\newpage
    \fi\fi\fi
}
\makeatother

\usepackage{titlesec}
\titleformat{\chapter}[frame]{\Huge\bfseries}{第\,\thechapter\,章}{1em}{}{}
\titleformat*{\subsection}{\Large\itshape}

% Mathematical symbols & operators
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Obj}{Obj} % No category theory will occur in this note
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\tensor}{Tsr}
\DeclareMathOperator{\grassmann}{Grm}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\interior}{int}
\def\form{\mathop\Omega\nolimits} % \DeclareMathOperator{\form}{\Omega} doesn't work
\DeclareMathOperator{\Mat}{Mat}
\DeclareMathOperator{\sgn}{sgn}
\newcommand{\norm}[1]{\Vert#1\Vert}

% Theorem environments
\renewcommand{\proofname}{{\bf 证明}}
\theoremstyle{definition}
\newtheorem{defn}{定义}[section]
\newtheorem{sym}[defn]{记号}
\newtheorem{eg}[defn]{例}
\theoremstyle{plain}
\newtheorem{thm}[defn]{定理}
\newtheorem{lem}[defn]{引理}
\newtheorem{col}[defn]{推论}
\newtheorem{prop}[defn]{命题}
\newtheorem*{pro}{问题}
\theoremstyle{remark}
\newtheorem{rem}[defn]{评注}
\newtheorem{ex}[defn]{习题}